package com.secondGroup.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * date 2022/5/5  15:52
 * Author: ws
 */
//@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        String [] addPathPatterns={"/**"};
        String []excludePathPatterns ={"/user/login","/user/register","user/error"};
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns(addPathPatterns)
                .excludePathPatterns(excludePathPatterns);

    }
}
